<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form id="myform" >
        <input type="text" name="username" id="username">
        <button id="reset">重置</button>
        <button id="submit">提交</button>
    </form>

    <script>
        var reset = document.getElementById("reset");
        var myform = document.getElementById("myform");
        var submit = document.getElementById("submit");
        
        reset.onclick = function(){
            myform.onreset();
        }
        submit.onclick = function(){
            myform.onsubmit();   
        }


    </script>
</body>
</html>